package Day01;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-04
 * Time: 20:20
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int max=0;
        //输入
        int n=sc.nextInt();
        int[] a_i=new int[n*3];
        for (int i = 0; i < n*3; i++) {
            a_i[i]=sc.nextInt();
        }
        //从最大的开始隔一个取一个
        Arrays.sort(a_i);
        for (int i = a_i.length-2; n>0; i-=2) {
            max+=a_i[i];
            n--;
        }
        System.out.println(max);
    }
}
